package org.force4spring.support;

/**
 * 
 * @author Max Rudman
 */
public class ThreadLocalCredentialsResolver implements ForceCredentialsResolver {
	private ThreadLocal holder = new ThreadLocal();
	
	/**
	 * @see org.force4spring.support.ForceCredentialsResolver#resolve()
	 */
	public ForceCredentials resolve() {
		return (ForceCredentials)holder.get();
	}

	public void assign(ForceCredentials credentials) {
		holder.set(credentials);
	}
	
	public void clear() {
		holder.set(null);
	}
}
